fix: uniform 'any arg = non-interactive' rule across all commands#78
Merged
lukeocodes merged 2 commits intomainfrom May 9, 2026
Merged
fix: uniform 'any arg = non-interactive' rule across all commands#78lukeocodes merged 2 commits intomainfrom
lukeocodes merged 2 commits intomainfrom
Conversation
Adds BaseCommand.is_guided(ctx) helper — returns True only when the user
invoked the command with zero input (no positional, no flag, no env var,
not in agentic mode). BaseCommand.execute now sets self._guided before
calling handle().
Threaded through:
- BaseCommand.confirm() and BaseCommand.prompt() now respect _guided in
addition to _agentic and ci_friendly. Single seam — every command
using these helpers automatically gets the rule.
- dg login: _maybe_prompt_skills_setup() now bails on either non-tty OR
not-guided. The new-profile and api-key prompts go through self.confirm
/ self.prompt and inherit the gate from BaseCommand.
- dg skills: three direct click.confirm/click.prompt calls migrated to
self.confirm — they now respect the gate. The 'install for all
detected tools' prompt also gates on _guided in addition to is_tty,
with the existing fallback ('non-TTY without --all installs all
detected') still active.
- dg debug browser: 'press Enter to open the debugger' prompt now skips
when not guided. Browser still opens; just no wait for confirmation.
- dg listen: unchanged — its existing local guided_flow boolean already
captures listen-specific intent (was the source-select prompt run?)
more precisely than the generic _guided. Listen tests are unaffected.
Tests: 4 new cases in TestIsGuided covering bare-invocation,
COMMANDLINE arg breaking guided, ENVIRONMENT var breaking guided, and
_agentic short-circuit. The rule applies uniformly: any user-provided
signal = scripting intent = no prompts.
Adds 19 unit tests across the BaseCommand seam and the three commands this PR touches: packages/deepctl-core/tests/unit/test_base.py - TestIsGuided (4 cases) — bare invocation, COMMANDLINE arg breaks, ENVIRONMENT var breaks, _agentic short-circuits - TestGuidedAttribute (3 cases) — __init__ defaults to True, execute() sets _guided=False when params come from COMMANDLINE, sets True for bare invocations - TestConfirmPromptGating (7 cases) — confirm/prompt call click when guided + not agentic + ci_friendly; return default when not guided, agentic, or not ci_friendly; prompt with default=None still prompts even when not guided (pre-existing safety, now locked in) packages/deepctl-cmd-login/tests/unit/test_login_command.py - TestMaybePromptSkillsSetup (3 cases) — returns early when not guided, returns early when not tty, proceeds to detect_ai_clis when both packages/deepctl-cmd-debug-browser/tests/unit/test_browser_command.py - TestBrowserGuidedGate (2 cases) — guided invocation waits for Enter, non-guided opens browser immediately The seam tests (TestConfirmPromptGating + TestGuidedAttribute) protect every command using self.confirm/self.prompt — if the gate regresses, all those commands silently break. Per-command tests verify the high-impact behavioural changes (login skills-setup early return, browser press-Enter skip). Skills migrations are covered transitively by TestConfirmPromptGating since the three direct click.* calls are now self.confirm calls. Pre-existing test_output_result_* failures in TestBaseCommand are unchanged (5 failures on main, same as flagged in #74).
Merged
lukeocodes
pushed a commit
that referenced
this pull request
May 9, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>0.2.24</summary> ## [0.2.24](v0.2.23...v0.2.24) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) * **telemetry:** track per-command usage via Sentry tags ([490b37e](490b37e)) * **telemetry:** turn on full Sentry observability for the CLI ([cc2c208](cc2c208)) * **web:** swap Sentry for Heap + GA4 on cli.deepgram.com ([e736528](e736528)) * **web:** swap Sentry for Heap + GA4 on cli.deepgram.com ([#76](#76)) ([b12a55b](b12a55b)) * **web:** wire real GA4 measurement ID G-TYPC1TBCKT ([a6468e4](a6468e4)) ### Bug Fixes * **telemetry:** explicitly start session after init ([8dd2843](8dd2843)) * **telemetry:** explicitly start session after init ([#74](#74)) ([ad75efa](ad75efa)) * uniform 'any arg = non-interactive' rule across all commands ([#78](#78)) ([6370f32](6370f32)) </details> <details><summary>deepctl-core: 0.2.12</summary> ## [0.2.12](deepctl-core-v0.2.11...deepctl-core-v0.2.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) * **telemetry:** track per-command usage via Sentry tags ([490b37e](490b37e)) ### Bug Fixes * uniform 'any arg = non-interactive' rule across all commands ([#78](#78)) ([6370f32](6370f32)) </details> <details><summary>deepctl-shared-utils: 0.1.12</summary> ## [0.1.12](deepctl-shared-utils-v0.1.11...deepctl-shared-utils-v0.1.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-telemetry: 0.0.4</summary> ## [0.0.4](deepctl-telemetry-v0.0.3...deepctl-telemetry-v0.0.4) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) * **telemetry:** turn on full Sentry observability for the CLI ([cc2c208](cc2c208)) ### Bug Fixes * **telemetry:** explicitly start session after init ([8dd2843](8dd2843)) * **telemetry:** explicitly start session after init ([#74](#74)) ([ad75efa](ad75efa)) </details> <details><summary>deepctl-cmd-login: 0.1.15</summary> ## [0.1.15](deepctl-cmd-login-v0.1.14...deepctl-cmd-login-v0.1.15) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) ### Bug Fixes * uniform 'any arg = non-interactive' rule across all commands ([#78](#78)) ([6370f32](6370f32)) </details> <details><summary>deepctl-cmd-debug-audio: 0.1.13</summary> ## [0.1.13](deepctl-cmd-debug-audio-v0.1.12...deepctl-cmd-debug-audio-v0.1.13) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-cmd-debug-browser: 0.1.12</summary> ## [0.1.12](deepctl-cmd-debug-browser-v0.1.11...deepctl-cmd-debug-browser-v0.1.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) ### Bug Fixes * uniform 'any arg = non-interactive' rule across all commands ([#78](#78)) ([6370f32](6370f32)) </details> <details><summary>deepctl-cmd-debug-network: 0.1.12</summary> ## [0.1.12](deepctl-cmd-debug-network-v0.1.11...deepctl-cmd-debug-network-v0.1.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-cmd-update: 0.2.5</summary> ## [0.2.5](deepctl-cmd-update-v0.2.4...deepctl-cmd-update-v0.2.5) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-cmd-plugin: 0.1.12</summary> ## [0.1.12](deepctl-cmd-plugin-v0.1.11...deepctl-cmd-plugin-v0.1.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-cmd-skills: 0.0.6</summary> ## [0.0.6](deepctl-cmd-skills-v0.0.5...deepctl-cmd-skills-v0.0.6) (2026-05-09) ### Bug Fixes * uniform 'any arg = non-interactive' rule across all commands ([#78](#78)) ([6370f32](6370f32)) </details> <details><summary>deepctl-cmd-listen: 0.0.13</summary> ## [0.0.13](deepctl-cmd-listen-v0.0.12...deepctl-cmd-listen-v0.0.13) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-cmd-completion: 0.0.3</summary> ## [0.0.3](deepctl-cmd-completion-v0.0.2...deepctl-cmd-completion-v0.0.3) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> <details><summary>deepctl-plugin-example: 0.1.12</summary> ## [0.1.12](deepctl-plugin-example-v0.1.11...deepctl-plugin-example-v0.1.12) (2026-05-09) ### Features * **telemetry:** full Sentry observability + per-command usage tags ([#75](#75)) ([0fe43d2](0fe43d2)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR #68 fixed the "any arg = non-interactive" rule for
dg listenonly. This PR extends the same rule uniformly to every command that prompts.How
New
BaseCommand.is_guided(ctx)helper — returnsTrueonly when the user invoked with zero input (no positional, no flag, no env var, not in agentic mode).BaseCommand.executesetsself._guidedbefore callinghandle().Threaded through one seam plus three call-site fixes:
BaseCommand.confirm/BaseCommand.prompt_guidedin addition to_agentic/ci_friendly. Every command using these helpers gets the rule for free.dg login_maybe_prompt_skills_setupself.confirmand inherit the gate.)dg skillsclick.confirm/click.promptcalls migrated toself.confirm. Theis_ttyskill-list prompt also gates on_guided(existing 'non-TTY without --all installs all' fallback still active).dg debug browser--non-interactiveis already that flag.)dg listenguided_flowboolean captures listen-specific intent more precisely than the generic_guided(was_interactive_select_sourceactually run?). Tests untouched.Tests
test_bare_invocation_is_guided— all params from DEFAULT/DEFAULT_MAP → guidedtest_any_commandline_arg_breaks_guided— one COMMANDLINE source breaks ittest_env_var_breaks_guided— ENVIRONMENT source also breaks ittest_agentic_short_circuits_to_false—_agentic=Truealways returns FalseThe 5 pre-existing
test_output_result_*failures inTestBaseCommandare unrelated and present onmain(flagged in #74's body).Behaviour matrix
dg login(bare)dg login --api-key Xdg skills install(bare in TTY)dg skills install --alldg skills install --tool claude --non-interactivedg debug browser(bare)dg debug browser --port 9000dg debug browser --non-interactive